<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>文章添加--layui后台管理模板</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="format-detection" content="telephone=no">
	<link rel="stylesheet" href="../../layui/css/layui.css" media="all" />
	<link rel="stylesheet" href="../../css/font_eolqem241z66flxr.css" media="all" />
	<script src="../../jquery-3.3.1/jquery-3.3.1.js"></script>

	<script src="../../jquery-3.3.1/jquery-3.3.1.min.js"></script>
	<script type="text/javascript" src="../../../tool/ajax.js"></script>
</head>
<body class="childrenBody">
	<form class="layui-form" style="display: flex;flex-direction: column;align-content: center">
		<div class="layui-form-item">
			<label class="layui-form-label">商户编号</label>
			<div class="layui-input-block">
				<input type="text"  id="usersid" class="layui-input newsName" lay-verify="required" placeholder="商户编号" disabled=true style="font-weight: bolder; background-color: #8B8878;color: #0FD5B6">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">商户账号</label>
			<div class="layui-input-block">
				<input type="text" id="username" class="layui-input newsName" lay-verify="required" placeholder="商户账号" disabled=true style="font-weight: bolder;background-color: #8B8878 ;color: #0FD5B6;">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">商户密码</label>
			<div class="layui-input-block">
				<input type="text" id="password" class="layui-input newsName" lay-verify="required" placeholder="商户账号"  style="font-weight: bolder;color: #0FD5B6;">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">商户余额</label>
			<div class="layui-input-block">
				<input type="text" id="money" class="layui-input newsName" lay-verify="required" placeholder="商户余额"
					   style="font-weight: bolder;color: #0FD5B6;">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">商户单价</label>
			<div class="layui-input-block">
				<input type="text" id="price" class="layui-input newsName" lay-verify="required" placeholder="商户单价"
					   style="font-weight: bolder;color: #0FD5B6;">
			</div>
		</div>
		<div class="layui-form-item">
			<!--<div class="layui-inline">-->
				<!--<label class="layui-form-label">是否启用</label>-->
				<!--<div class="layui-input-block">-->
					<!--<input type="checkbox" name="tuijian" class="tuijian" title="启用" >-->
				<!--</div>-->
			<!--</div>-->
			<div class="layui-inline">
				<label class="layui-form-label">创建时间</label>
				<div class="layui-input-inline">
					<input type="text"id="createtime" class="layui-input newsTime" lay-verify="date"style="font-weight: bolder;background-color: #8B8878 ;color: #0FD5B6;" disabled="true" onclick="layui.laydate({elem:this})">
				</div>
			</div>
			<div class="layui-inline">
				<label class="layui-form-label">已消费</label>
				<div class="layui-input-inline">
					<input type="text" id="expend" class="layui-input newsTime" lay-verify="date"style="font-weight: bolder;background-color: #8B8878 ;color: #0FD5B6;" disabled="true" onclick="layui.laydate({elem:this})">
				</div>
			</div>
			<div class="layui-inline">
				<label class="layui-form-label">浏览权限</label>
				<div class="layui-input-inline">
					<select name="browseLook" class="newsLook" lay-filter="browseLook">
				        <option value="0">管理员</option>
				        <option value="1">小管理员</option>
						<option value="2">小小管理员</option>
				    </select>
				</div>
			</div>
		</div>
		<button
				type="button" align="center"  onclick="edituser()"  style="width:30%;margin: 0 auto;" class="layui-btn layui-btn-normal layui-btn-radius">提交信息
		</button>
		<!--<div class="layui-form-item">-->
			<!--<label class="layui-form-label">关键字</label>-->
			<!--<div class="layui-input-block">-->
				<!--<input type="text" class="layui-input" placeholder="请输入文章关键字">-->
			<!--</div>-->
		<!--</div>-->
		<!--<div class="layui-form-item">-->
			<!--<label class="layui-form-label">内容摘要</label>-->
			<!--<div class="layui-input-block">-->
				<!--<textarea placeholder="请输入内容摘要" class="layui-textarea"></textarea>-->
			<!--</div>-->
		<!--</div>-->
		<!--<div class="layui-form-item">-->
			<!--<label class="layui-form-label">文章内容</label>-->
			<!--<div class="layui-input-block">-->
				<!--<textarea class="layui-textarea layui-hide" name="content" lay-verify="content" id="news_content"></textarea>-->
			<!--</div>-->
		<!--</div>-->
		<!--<div class="layui-form-item">-->
			<!--<div class="layui-input-block">-->
				<!--<button class="layui-btn" lay-submit="" lay-filter="addNews">立即提交</button>-->
				<!--<button type="reset" class="layui-btn layui-btn-primary">重置</button>-->
		    <!--</div>-->
		<!--</div>-->
	</form>
	<script type="text/javascript" src="../../layui/layui.js"></script>
	<script type="text/javascript" src="useredit.js"></script>
</body>
<script>
    function edituser() {
        var userid = document.getElementById("usersid").value;
        var password = document.getElementById("password").value;
        var money = document.getElementById("money").value;
        var price = document.getElementById("price").value;
        console.log(money)
        ajaxpost("admin/useredit", {usersid: userid, password: password, money: money,price:price}, function (data) {
            try {
                console.log("服务器请求会发")
                if (data.val == 200) {
                    layer.msg('编辑成功', {
                        icon: 1,
                        time: 2000 //2秒关闭（如果不配置，默认是3秒）
                    }, function () {
                        parent.location.reload();
                    });
                } else {
                    layer.msg('编辑失败', {
                        icon: 0,
                        time: 2000 //2秒关闭（如果不配置，默认是3秒）
                    }, function () {

                        parent.location.reload();
                    });
                }
            } catch (e) {
                layer.msg('编辑失败', {
                    icon: 0,
                    time: 2000 //2秒关闭（如果不配置，默认是3秒）
                }, function () {
                    parent.location.reload();
                });
            }
        })
    }


</script>
</html>